/*
* @Author: wanghongfucoder
* @Date:   2017-03-06 14:09:03
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-03-06 14:20:51
*/

import java.util.HashMap;

public  class ShapeFactory  {
	private static  final HashMap<String, Shape> map = new HashMap<>();
	public 	static Shape getCircle(String color){
		Circle circle=(Circle) map.get(color);
		if (circle==null) {
			circle=new Circle(color);
			map.put(color,circle);
			System.out.println("Creating circle of color : "+color);
		}
		return circle;
	}
}